CC = gcc
CFLAGS = -c
PROG = common


all : generic

c_mcd: mcd.c
	$(CC) $(CFLAGS) mcd.c

c_mcm: mcm.c
	$(CC) $(CFLAGS) mcm.c

as_mcd: mcd.S
	$(CC) $(CFLAGS) mcd.S

as_mcm: mcm.S
	$(CC) $(CFLAGS) mcm.S

common: common.c
	$(CC) $(CFLAGS) common.c

mips: as_mcd as_mcm common
	$(CC) mcd.o mcm.o common.o -o $(PROG)

generic: c_mcd c_mcm common
	$(CC) mcd.o mcm.o common.o -o $(PROG)


	
clean:
	rm -rf *.o $(PROG)
